package edu.hunau.cxb19.oop.class17;

import org.junit.Test;

import edu.hunau.cxb19.oop.class17.generic.CollectionUtils;
import edu.hunau.cxb19.oop.class17.generic.MyList;

/**
 *
 * @author hb
 *
 *         2020-03-18 15:50:48
 */
public class MyListTest {

	@Test
	public void call() {
		MyList list = new MyList();
		list.add(1);
		list.add("abc");
		list.add(1.2);
		System.out.println(list.size());
		// 获得下标为零的数据
		Integer i = (Integer) list.get(0);
	}

	@Test
	public void test02() {
		MyList<String> list = new MyList<>();
		list.add("abc");
		list.add(new String("abc123"));
		list.add(new String("abc123"));
		list.add(new String("abc123"));
		list.add(new String("abc123"));
		list.add(new String("abc123"));
		// list.add(1);
		//list.add(1.2);
		System.out.println(list.size());
		list.get(2);
		list.get(6);
	
	}
	
	@Test
	public void test03() {
		MyList<String> list = new MyList<>();
		
		CollectionUtils.addAll(list, "abc","123","345");
		
		System.out.println(list.size());
		System.out.println(list.get(0));
		
	}
}
